package com.ruicar.afs.cloud.apply.channel.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.apply.channel.condition.*;
import com.ruicar.afs.cloud.apply.channel.entity.BlacklistTemp;
import com.ruicar.afs.cloud.apply.channel.entity.ChannelAuthorizeRegionTemp;
import com.ruicar.afs.cloud.apply.channel.entity.ChannelListingCarTempVo;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.image.entity.ComAttachmentFile;
import com.ruicar.afs.cloud.parameter.commom.condition.VehicleTreeCondition;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author Ice
 * @Date 2020/6/22
 */
@FeignClient(name = "channel", url = "${com.greatwall.services.channel-service.url}")
public interface ApplyUseChannelFeign {
    @PostMapping(value = "/carRel/getApplyListingCarTemp")
    @ApiOperation("查询渠道分页获取挂靠车数据")
    IResponse getChannelListingCarTemp(@RequestBody ChannelListingCarRelTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/getChannelInfo")
    @ApiOperation("查询渠道分页获取挂靠数据")
    IResponse getChannelInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/deleteInfo")
    @ApiOperation("删除挂靠车备案")
    IResponse<Boolean> deleteInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/upDateStatusByIdForApply")
    @ApiOperation("停用挂靠关系")
    IResponse<Boolean> upDateStatusByIds(@RequestBody String ids, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/caseAffiliation/pushToCaseAffiliationRel")
    @ApiOperation("停用挂靠同步案件")
    IResponse upDateCaseStatusByIds(@RequestBody ApplyAffiliatedToCaseCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/delete")
    @ApiOperation("删除挂牌车备案")
    IResponse carTempDelete(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/applyEdit")
    @ApiOperation("修改渠道挂牌车备案")
    IResponse carTempEdit(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/black/checkBlack")
    @ApiOperation("校验黑名单")
    Object checkBlack(@RequestBody BlacklistTemp condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/upApplyAllByIds")
    @ApiOperation("根据id更新挂靠状态")
    IResponse carTempUpAllByIds(@RequestBody String ids, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/applySave")
    @ApiOperation("保存渠道挂牌车备案")
    IResponse carTempSave(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/getById")
    @ApiOperation("挂牌车根据Id查询对应的数据")
    IResponse getCarTempById(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/carRel/toExamine")
    @ApiOperation("进件调用渠道挂牌车审核")
    IResponse channelToExamine(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/getChannelWitnessListData")
    @ApiOperation("进件调用渠道分页查询见证人数据列表")
    IResponse getChannelWitnessListData(@RequestBody ChannelWitnessInfoTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/delete")
    @ApiOperation("根据id删除见证人")
    IResponse channelDelWitness(@RequestBody ChannelWitnessInfoTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/upAllByIds")
    @ApiOperation("根据id批量停用见证人")
    IResponse wintnessUpAllByIds(@RequestBody WitnessExpandCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/getWitnessById")
    @ApiOperation("根据id查询见证人信息")
    IResponse getWitnessById(@RequestBody ChannelWitnessInfoTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/applySave")
    @ApiOperation("进件保存见证人")
    IResponse witnessSave(@RequestBody ChannelWitnessInfoTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/addAffiliationInfo")
    @ApiOperation("进件添加第三方挂靠")
    IResponse addAffiliationInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/addNetCarAffiliationInfo")
    @ApiOperation("进件添加网约车挂靠")
    IResponse addNetCarAffiliationInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/upDateAffiliationInfo")
    @ApiOperation("进件更新挂靠")
    IResponse upDateAffiliationInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/getAffiliationInfoById")
    @ApiOperation("获取挂靠信息byId")
    IResponse getAffiliationInfoById(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/getAffiliationInfo")
    @ApiOperation("获取启用挂靠信息")
    IResponse getAffiliationInfo(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/examineNewThird")
    @ApiOperation("审核新增第三方")
    IResponse examineNewThird(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/examineThird")
    @ApiOperation("审核修改第三方")
    IResponse examineThird(@RequestBody AffiliationCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/caseAffiliation/pushToCaseAffiliation")
    @ApiOperation("审核同步案件")
    IResponse saveThirdOrNetCar(@RequestBody ApplyAffiliatedToCaseCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelAffiliated/getMainAreaById")
    @ApiOperation("获取地址")
    IResponse getMainAreaById(@RequestBody ChannelAuthorizeRegionTemp channelAuthorizeRegionTemp, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/editApply")
    @ApiOperation("进件修改见证人")
    IResponse witnessEdit(@RequestBody ChannelWitnessInfoTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/black/save")
    @ApiOperation("进件见证人申请黑名单")
    IResponse witnessSaveBlack(@RequestBody BlacklistTempCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/checkRole")
    @ApiOperation("进件见证人停用查询角色权限和正在见证中的合同")
    Object witnessCheckRole(@RequestBody JSONObject json, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/witness/toExamine")
    @ApiOperation("进件见证人申请审核")
    IResponse witnessToExamine(@RequestBody BlacklistTempCondition condition, @RequestHeader Map<String, String> headers);

    //车商调渠道接口
    @GetMapping("/carDealer/getAllSaleManByChannelId/{channelId}/{businessType}")
    @ApiOperation(value = "根据渠道id获取所有业务员")
    IResponse getAllSaleManByChannelId(@PathVariable(value = "channelId") String channelId, @PathVariable(value = "businessType") String businessType, @RequestHeader Map<String, String> requestHeader);

    @GetMapping("/carDealer/bulkEditingSalesmanFromApply/{salesman}/{ids}/{channelId}")
    @ApiOperation(value = "进件端批量修改业务员")
    IResponse bulkEditingSalesmanFromApply(@PathVariable(value = "salesman") String salesman, @PathVariable(value = "ids") String[] ids, @PathVariable(value = "channelId") String channelId, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/getByCondition")
    @ApiOperation(value = "多条件分页获取普通车商")
    IResponse getCommonCarDealerList(CommonCarDealerCondition carDealerCondition, @RequestHeader Map<String, String> requestHeader);

    @GetMapping("/carDealer/disableCarDealerFromApply/{ids}/{channelId}/{status}")
    @ApiOperation(value = "停用进件端普通车商")
    IResponse disableCarDealerFromApply(@PathVariable(value = "ids") String[] ids, @PathVariable(value = "channelId") String channelId, @PathVariable(value = "status") String status, @RequestHeader Map<String, String> requestHeader);

    /*@GetMapping("/carDealer/bulkEditingSalesmanFromApply/{salesman}/{ids}/{channelId}")
    @ApiOperation(value = "批量修改业务员")
    IResponse bulkEditingSalesman(@PathVariable(value = "salesman") String salesman, @PathVariable(value = "ids") String[] ids, @PathVariable(value = "channelId") String channelId, @RequestHeader Map<String, String> requestHeader);
*/
    @GetMapping("/carDealer/getChannelsByCardealerId/{id}")
    @ApiOperation(value = "根据普通车商id获取渠道信息")
    IResponse getChannelsByCardealerId(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @DeleteMapping("/carDealer/deleteCommonCardealerByIdFromApply/{id}/{channelId}")
    @ApiOperation(value = "从进件端删除删除普通车商")
    IResponse deleteCommonCardealerById(@PathVariable(value = "id") String id, @PathVariable(value = "channelId") String channelId, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/addCarDealer")
    @ApiOperation(value = "增加普通车商")
    IResponse addCarDealer(@RequestBody CommonCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/editCarDealer")
    @ApiOperation(value = "编辑普通车商")
    IResponse editCarDealer(@RequestBody CommonCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @GetMapping("/carDealer/getcommonCarDealerInfoById/{id}")
    @ApiOperation(value = "根据普通车商id获取车商信息")
    IResponse getcommonCarDealerInfoById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getMaiBrandById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取主营品牌信息")
    IResponse getMaiBrandById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getInfoById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取基本信息")
    public IResponse getInfoById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    //直营车商的接口
    @GetMapping("/carDealer/disableDirectCarDealerFromApply/{ids}/{channelId}/{status}")
    @ApiOperation(value = "禁用进件端直营车商")
    IResponse disableDirectCarDealerFromApply(@PathVariable(value = "ids") String[] ids, @PathVariable(value = "channelId") String channelId, @PathVariable(value = "status") String status, @RequestHeader Map<String, String> requestHeader);

    @DeleteMapping("/carDealer/deleteDirectCardealerByIdFromApply/{channelId}/{id}")
    @ApiOperation(value = "删除进件端直营车商")
    IResponse deleteDirectCardealerByIdFromApply(@PathVariable(value = "channelId") String channelId, @PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);


    @PostMapping("/carDealer/bulkEditingCustomerManager")
    @ApiOperation(value = "批量修改进件端直营车商城市经理")
    IResponse bulkEditingCustomerManager(@RequestBody ChangeSalesmanCondition condition, @RequestHeader Map<String, String> requestHeader);


    @PostMapping("/carDealer/getAllCardealerNameByChannelId")
    @ApiOperation(value = "获取合作商下所有车商名称")
    IResponse getAllCardealerNameByChannelId(@RequestBody CommonCarDealerCondition carDealerCondition, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/getDirectCarDealerListByCondition")
    @ApiOperation(value = "多条件分页获取直营车商")
    IResponse getDirectCarDealerList(@RequestBody CommonCarDealerCondition carDealerCondition, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/carDealer/saveDirectCarDealer", method = RequestMethod.POST)
    @ApiOperation(value = "保存直营车商申请信息")
    IResponse saveDirectCarDealer(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/carDealer/stagingSaveDirectCarDealer", method = RequestMethod.POST)
    @ApiOperation(value = "暂存直营车商申请信息")
    IResponse stagingSaveDirectCarDealer(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/carDealer/updateDirectCarDealer", method = RequestMethod.POST)
    @ApiOperation(value = "更新直营车商信息")
    IResponse updateDirectCarDealer(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/savaInvoiceInfo")
    @ApiOperation(value = "保存开票信息")
    IResponse savaInvoiceInfo(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);


    @RequestMapping(value = "/carDealer/saveAccountInfo", method = RequestMethod.POST)
    @ApiOperation(value = "保存收款账号数据")
    IResponse saveAccountInfo(@RequestBody ChannelAccountInfoCondition condition, @RequestHeader Map<String, String> requestHeader);


    @PostMapping(value = "/carDealer/getAreaListCondition")
    @ApiOperation(value = "多条件分页获取直营车商展业")
    IResponse getAreaListCondition(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @GetMapping(value = "/carDealer/getAccountInfoByChannelId/{channelId}")
    @ApiOperation(value = "根据渠道id查询账户信息")
    IResponse getAccountInfoByChannelId(@PathVariable(value = "channelId") String channelId, @RequestHeader Map<String, String> requestHeader);

    @PostMapping("/carDealer/checkCooper")
    @ApiOperation(value = "验证直营车商和合作商之间的关系")
    IResponse checkCooper(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getRiskById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取风控信息")
    IResponse getRiskById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getQuotaInfoById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取保证金信息")
    IResponse getQuotaInfoById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getMainAreaById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取授权区域信息")
    public IResponse getMainAreaById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getVehicleById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取授权车型信息")
    IResponse getVehicleById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/carDealer/getAccountInfo", method = RequestMethod.POST)
    @ApiOperation(value = "多条件分页获取收款账号信息")
    IResponse getAccountInfo(@RequestBody DirectCarDealerCondition condition, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/deleteAccount/{ids}", method = RequestMethod.DELETE)
    @ApiOperation(value = "删除收款账号信息")
    IResponse<Boolean> deleteAccount(@PathVariable(value = "ids") String[] ids, @RequestHeader Map<String, String> requestHeader);


    @RequestMapping(value = "/carDealer/updateAccountInfo", method = RequestMethod.POST)
    @ApiOperation(value = "修改收款账号数据")
    IResponse updateAccountInfo(@RequestBody ChannelAccountInfoCondition condition, @RequestHeader Map<String, String> requestHeader);

    @GetMapping(value = "/carDealer/changeAccountStatus/{channelId}")
    @ApiOperation(value = "启用车商收款账号")
    IResponse changeAccountStatus(@PathVariable(value = "channelId") String channelId, @RequestHeader Map<String, String> requestHeader);

    @GetMapping("/carDealer/getAreaByChannelId/{channelId}/{businessType}")
    @ApiOperation(value = "根据渠道id获取授权区域")
    IResponse getAreaByChannelId(@PathVariable(value = "channelId") String channelId, @PathVariable(value = "businessType") String businessType, @RequestHeader Map<String, String> requestHeader);

    /**
     * 获取挂靠次数
     *
     * @param id
     * @param headers
     * @return
     */
    @ApiOperation("获取挂靠次数")
    @RequestMapping(value = "/caseAffiliation/affiliatedCount/{id}", method = RequestMethod.POST)
    JSONObject affiliatedCount(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> headers);

    @RequestMapping(value = "/vehicle/getBrandTree", method = RequestMethod.POST)
    @ApiOperation(value = "获取品牌树状图")
    IResponse getBrandTree(@RequestBody VehicleTreeCondition condition,@RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getOldVehicleById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取二手车授权车型信息")
    IResponse getNewVehicleById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @RequestMapping(value = "/channelOnline/getOldVehicleById/{id}", method = RequestMethod.POST)
    @ApiOperation(value = "根据渠道id获取二手车授权车型信息")
    IResponse getOldVehicleById(@PathVariable(value = "id") String id, @RequestHeader Map<String, String> requestHeader);

    @PostMapping(value = "/channelFilter/getListingCarParams")
    @ApiOperation("获取挂牌车挂牌车附件条件")
    IResponse getListingCarParams(@RequestBody ChannelListingCarTempVo condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/common/syncFileToChannel")
    @ApiOperation("同步影像件到渠道服务")
    IResponse syncFileToChannel(List<ComAttachmentFile> fileList, @RequestHeader Map<String, String> requestHeader);


}
